<?php
  /*
   * Template Name: news
   */
?>

<?php
  get_header();
?>

<div class="page2 news">
  <div class="wrap clearfix">
    <div class="new-list">
        <ul class="clearfix">
          <?php

            $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
            $posts_per_page = 8;
            $my_query = new WP_Query('cat='.get_query_var('cat') ."&posts_per_page=-1");

              $args = array(
                'caller_get_posts' => 1,
                'cat'              => get_query_var('cat'),
                'paged'            => $paged,
                'posts_per_page'   => $posts_per_page
              );

              query_posts($args);
              while ( have_posts()) {
                the_post();
            ?>

              <li class="new-item">
                <a href="<?php echo home_url('index.php/content?cat='.$post->ID); ?>" class="link-wrap">
                  <span class="new-title"><?php  the_title(); ?></span>
                  <span class="date"><?php  the_time('Y-m-j'); ?></span>
                </a>
              </li>
            <?php }  ?>
        </ul>
      </div>

      <div class="page">
        <?php
          pagination('cat='.get_query_var('cat'));
        ?>

        <div class="status">
          总共 <em><?php echo $my_query->post_count;?></em> 条记录
          当前是第 <em><?php echo $paged; ?></em> 页
        </div>
      </div>
  </div>
</div>

<?php
  get_footer();
?>